<!DOCTYPE html>
<html>
<head>
<title>js的循环语句</title>

<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">

<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->


</head>

<body>
	<script type="text/javascript">
		var a = "21";
		var b = 21;
		document.write(a == b);//等于
		document.write(a === b);//绝对等于
		//区别在于当一个是字符串时,a==b返回的是true,而a===b返回的是false--知识点
		//原因在于三个等号组成的运算符必须满足类型也相同

		//!=  !==两个与以上类似
		a = "11";
		b = 11;
		document.write(a != b);//等于
		document.write(a !== b);//绝对等于
	</script>
	<br />
	<script>
		var arr = new Array(1, 45, 8, 4, 36, 3, 4);
		//for...in语句,与Java中的for...each语句不同--
		for ( var j in arr) {

			document.write(arr[j] + "、");
		}
		document.write("--------");
		var i = 0;
		while (i < 6) {
			document.write(arr[i] + "、");
			i++;
		}
		document.write("--------");
		var i = 0;
		do {
			document.write(arr[i] + "、");
			i++;
		} while (i < 6);
		document.write("--------");
		for ( var j = 0; j < 6; j++) {
			document.write(arr[j] + "、");
		}
	</script>


</body>
</html>
